#include <stdio.h>

int calculateAverage(int *arr, int size)
{
    int sum = 0;
    int average = 0;
    int *p = arr;

    for(int i = 0; i < size; i++)
    {
        sum += *p;
        p++;
    }

    average = sum/size;

    return average;
}

int main()
{
    int arr[5] = {1, 2, 3, 4, 5};
    int size = sizeof(arr)/sizeof(arr[0]);
    int ave = calculateAverage(arr, size);

    printf("average = %d\n", ave);

    return 0;
}